import request from '@/utils/request'

// 获取藏品列表
export function getCollectionList(params) {
  return request({
    url: '/collection/list',
    method: 'get',
    params
  })
}

// 获取藏品详情
export function getCollectionDetail(id) {
  return request({
    url: `/collection/${id}`,
    method: 'get'
  })
}

// 创建藏品
export function createCollection(data) {
  return request({
    url: '/collection/create',
    method: 'post',
    data
  })
}

// 更新藏品
export function updateCollection(id, data) {
  return request({
    url: `/collection/${id}`,
    method: 'put',
    data
  })
}

// 删除藏品
export function deleteCollection(id) {
  return request({
    url: `/collection/${id}`,
    method: 'delete'
  })
}

// 获取藏品分类
export function getCollectionCategories() {
  return request({
    url: '/collection/categories',
    method: 'get'
  })
}

// 点赞藏品
export function likeCollection(id) {
  return request({
    url: `/collection/${id}/like`,
    method: 'post'
  })
}

// 收藏藏品
export function favoriteCollection(id) {
  return request({
    url: `/collection/${id}/favorite`,
    method: 'post'
  })
}